<?php
session_start() ;
if(!isset($_SESSION["login"]) || $_SESSION["login"] == "")
{   
  header("Location: index.php?error=4") ;
}?>

<html>
<head>
<title>Administration</title>
 <link rel="stylesheet" type="text/css" href="style.css" >  
</head>

<body>
<?php require("menu.php");
require("fonctions.php");
$code=$_GET["error"];
?>
<p class="titre">Fiche de synth&egrave;se des d&eacute;cisions RT</p>
<br></br>
<table>
<tr>
	<td class="tab_dis_head" colspan=3>Liste des demandes r&eacute;seau et des d&eacute;cisions RT</td>
</tr>
</table>
<table class="tab_dis">
<tr>
	<td class="tab_dis_head">ID_INTERV</td>
	<td class="tab_dis_head">ETABLISSEMENT</td>
	<td class="tab_dis_head">STATUT</td>
	<td class="tab_dis_head">ACTION</td>
	<td class="tab_dis_head"></td>
</tr>
<?php 
$sql="select * from data_temp where decision<>0";
$res = mysql_query($sql);
while($r = mysql_fetch_object($res)){
?>
<tr>
	<td class="tab_dis_data"><?php echo $r->id_interv;?></td>
	<td class="tab_dis_data"><?php echo $r->distributeur;?></td>
	<td class="tab_dis_data"><?php echo $r->statut;?></td>
	<td class="tab_dis_data"><a class="bouton" href="man_synth_mail.php?action=voir_decision_mail&cur=12&id_interv=<?php echo $r->id_interv;?>">Voir la r&eacute;ponse RT</a></td>
	<?php if(getStatutSynthEnvoi($r->id_interv)!=""){ $val = getStatutSynthEnvoi($r->id_interv);?>
	<td class="tab_dis_data">Dernier mail envoy&eacute; le <?php echo $val;?></td>
	<?php }?>
</tr>

<?php }?>
</table>

<br></br>
<p class="titre">R&eacute;capitulatif du nombre de connexion au site par distributeur </p>

<table class="tab_dis">
<tr>
<td class="tab_dis_head">ID_USER</td>
<td class="tab_dis_head">PROFIL</td>
<td class="tab_dis_head">ETABLISSEMENT</td>
<td class="tab_dis_head">NBRE DE CONNEXIONS</td>
<td class="tab_dis_head">DATE</td>

</tr>
<?php $sql="select count(id_user) as nombre,id_user,profil,date_con from histo_con  where profil='DIS'
group by profil,id_user
order by id desc";
	$res =mysql_query($sql);
	while($r=mysql_fetch_object($res)){
?>
<tr><td class="tab_dis_data"><?php echo $r->id_user?></td>
<td class="tab_dis_data"><?php echo $r->profil?></td>
<td class="tab_dis_data" ><?php if($r->profil=="DIS") echo $val = getDistribName($r->id_user)?></td>
<td class="tab_dis_data" align=center><?php echo $r->nombre?></td>
<td class="tab_dis_data"><?php echo $r->date_con?></td></tr>
<?php }?>
</table>
</body>

</html>
